package zmisc

import (
	"fmt"
	"runtime"
)

// GetGoroutineID 获取携程ID
func GetGoroutineID() int {
	var buf [64]byte
	runtime.Stack(buf[:], false)
	var id int
	fmt.Sscanf(string(buf[:]), "goroutine %d", &id)
	return id
}
